package com.yuandian.management.socket.client;


import com.yuandian.management.socket.entity.SocketRequest;
import com.yuandian.management.socket.entity.SocketResponse;

import java.util.List;

/**
 * 客户端接口
 *
 * @author: tangqingchun
 * @date: 2019-10-08
 */
public interface SocketClient {

    /**
     * 执行单个IP请求
     *
     * @param request
     * @param ip
     * @return
     * @throws Exception
     */
    public <T extends SocketResponse> T execute(SocketRequest<T> request, String ip) throws Exception;

    /**
     * 执行多个IP请求
     *
     * @param request
     * @param ipList
     * @return
     * @throws Exception
     */
    public <T extends SocketResponse> List<T> execute(SocketRequest<T> request, List<String> ipList) throws Exception;
}
